package com.openbravo.pos.panels.model;

import java.util.List;

import javax.swing.table.AbstractTableModel;

import com.openbravo.bean.SalesLine;
import com.openbravo.pos.base.AppLocal;

public class SalesTableModel extends AbstractTableModel {
	private final static String[] SALEHEADERS = {"label.taxcash", "label.totalcash"};
	List<SalesLine> m_lsales;

    public SalesTableModel(List<SalesLine> m_lsales) {
		this.m_lsales = m_lsales;
	}
	public String getColumnName(int column) {
        return AppLocal.getIntString(SALEHEADERS[column]);
    }
    public int getRowCount() {
        return m_lsales.size();
    }
    public int getColumnCount() {
        return SALEHEADERS.length;
    }
    public Object getValueAt(int row, int column) {
        SalesLine l = m_lsales.get(row);
        switch (column) {
        case 0: return l.getTaxName();
        case 1: return l.getTaxes();
        default: return null;
        }
    }  
};
